const logger = require('../middleware/logger');
const auth = require('../middleware/auth');

/**
 * @param {import('../index').Application} app 
 */
module.exports = (app) => {
  const { router, controller } = app;

  const consulRouter = router.namespace('/consul', logger, auth);

  consulRouter.get('/get-child-key', controller.consul.getChildKey);
  consulRouter.get('/get-value', controller.consul.getValue);
  consulRouter.put('/update-key', controller.consul.updateKey);
  consulRouter.delete('/delete-key', controller.consul.deleteKey);
  consulRouter.put('/create-key', controller.consul.createKey);
  consulRouter.get('/get-history', controller.consul.getHistory);
};